extends Node2D

# You might add score tracking, game state management (playing, gameover), etc. here

func _ready():
	# Ensure the game isn't paused at the start if previously paused
	get_tree().paused = false
	# You could potentially connect the player's game_over signal here
	# var player = $Player # Assuming direct child relationship
	# player.connect("game_over_signal", _on_player_game_over)

func _unhandled_input(event):
	# Simple pause toggle with Escape key (optional)
	if event.is_action_pressed("ui_cancel"): # ui_cancel is typically Escape
		if not $UI/LevelUpScreen.visible: # Don't toggle pause if level up screen is showing
			get_tree().paused = !get_tree().paused
			print("Game Paused: ", get_tree().paused)

# func _on_player_game_over():
	# Handle game over logic, e.g., show a game over screen from the UI
	# $UI.show_game_over_screen(final_score, final_time)
